@echo off & setlocal enabledelayedexpansion
:a
set str=0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
set /a b=%random%%%62
set /a c+=1
for %%i in (!b!) do (
	set q=!q!!str:~%%i,1!
)
if not !c! == 6 goto :a

echo !q!